﻿@model IList<IDocentes>
@if (Model != null && Model.Count > 0)
{ 
    <div  style="text-align: center;">
        <table id="grilla" align="center" id="mytable" width="722px" cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <th height="30">
                        <div align="left">
                            Cuit</div>
                    </th>
                    <th height="30">
                        <div align="center">
                            Razon Social</div>
                    </th>
                    <th height="30">
                        <div align="center">
                            Cargo</div>
                    </th>
                    <th height="30">
                        <div align="right" style="margin-right: 2px;">
                            Acción
                        </div>
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td align="left" height="28" width="180">
                            @if (item.Cuit_Cuil.Length < 13)
                            { @item.Cuit_Cuil}
                            else
                            {@(item.Cuit_Cuil.Substring(0, 13) + "...") }
                        </td>
                        <td align="center">
                            @if (item.RazonSoial.Length < 30)
                            {  @item.RazonSoial}
                            else
                            {@( @item.RazonSoial.Substring(0, 30) + "...") }
                        </td>
                        <td align="center">
                            @if (item.NombreCargo.Length < 13)
                            {  @item.NombreCargo}
                            else
                            {@(item.NombreCargo.Substring(0, 13) + "...") }
                        </td>
                        <td align="right" style="margin-right: 2px;">
                            @Html.ActionLink("Modificar", "Modificar", "Docentes", new { id_docente = item.Id_Docente }, new { @class = "btnIngresar" })
                            @Html.ActionLink("Eliminar", "Eliminar", "Docentes", new { id_docente = item.Id_Docente }, new { @class = "btnIngresar" })
                            @Html.ActionLink("Ver", "Consultar", "Docentes", new { id_docente = item.Id_Docente }, new { @class = "btnIngresar" })
                        </td>
                    </tr>
                }
                <tr>
                    <td align="left" valign="middle" colspan="2" height="20">
                        <div id="resumenPag" style="height: 20px; padding: 10px 5px 0 2px;">
                        </div>
                    </td>
                    <td align="right" valign="bottom" colspan="2" height="20">
                        <div style="height: 20px; padding: 15px 5px 0 2px;">
                            @Html.ActionLink("Agregar Docente", "Agregar", "Establecimientos", new { @class = "btnIngresar" })
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
           
}
else
{
@*<div id="tab" style="text-align: center;">
        <table align="center" id="mytable">
            <thead>
                <tr>
                    <th height="30">
                        <div align="center">
                            SIN DATOS</div>
                    </th>
                </tr>
            </thead>
        </table>
    </div>*@
    <table id="grilla" align="center" width="722px" cellpadding="0" cellspacing="0">
        <tr>
            <td width="722px">
                @Html.Partial("_SinDatos", "Docentes")
            </td>
        </tr>
        <tr>
            <td>
                <div align="right" style="height: 20px; padding: 15px 5px 0 2px;">
                    @Html.ActionLink("Agregar Docente", "Agregar", "Establecimientos", new { @class = "btnIngresar" })
                </div>
            </td>
        </tr>
    </table>
}
